//
//  HMNOSelectCheapTableViewCell.m
//  HMMarket
//
//  Created by haohao on 2017/6/15.
//  Copyright © 2017年 homai. All rights reserved.
//

#import "HMNOSelectCheapTableViewCell.h"

@implementation HMNOSelectCheapTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [_selectBtn setImage:[UIImage imageNamed:@"Cart_pitchon"] forState:UIControlStateNormal];
    [_selectBtn setImage:[UIImage imageNamed:@"Cart_pitchon_h"] forState:UIControlStateSelected];
    [_selectBtn addTarget:self action:@selector(changeState) forControlEvents:UIControlEventTouchUpInside];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    // Initialization code
}

- (void)setNotUser:(BOOL)notUser {
    _notUser = notUser;
    _selectBtn.selected = _notUser;
}

- (void)changeState {
    _selectBtn.selected = !_selectBtn.selected;
    if ([_delegate respondsToSelector:@selector(sendSelectType:)]) {
        [_delegate sendSelectType:_selectBtn.selected];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
